<#include "/tags/updatedSinceTag.ftl">
<#macro notificationItem id action component componentId read 
		actionOwnerName updateDate updatedMinutes
		actionOwnerAvatar="/images/avatar.png">
	<#assign link="#"/>
	<#assign actionText=""/>
	<#assign componentText=""/>                            	
	<#if component=="GOAL_ENTRY">
		<#assign link="${rc.contextPath}/entry/view/${componentId}"/>
		<#assign componentText="bài viết"/>  
	<#elseif component=="DONE_ENTRY">
		<#assign link="${rc.contextPath}/done/view/${componentId}"/>
		<#assign componentText="bài chia sẻ"/>
	<#elseif component=="USER_THOUGHT">
		<#if action=="NEW">
			<#assign link="${rc.contextPath}/wall.html"/>
			<#assign componentText="trên tường"/>
		<#else>
			<#assign link="${rc.contextPath}/wall.html"/>
			<#assign componentText="bài trên tường"/>
		</#if>
	</#if>
	
	<#if action=="CHEER">
		<#assign actionText="chúc mừng"/>                            		                            			
	<#elseif action=="ENCOURAGE">
		<#assign actionText="động viên"/>
	<#elseif action=="LIKE">
		<#assign actionText="thích"/>
	<#elseif action=="COMMENT">
		<#assign actionText="trả lời"/>
	<#elseif action=="NEW" && component=="USER_THOUGHT">
		<#assign actionText="đăng gì đó"/>
	</#if>
	
	<#if actionText?has_content && componentText?has_content>
	    <li id="${updateDate}" rel="${id}" class="${read?string('read','unread')}">
	        <a href="${link}" class="noticeLink">
	            <span class="avatarUser"><img src="${actionOwnerAvatar}" width="50" height="50"/></span>
	            <p class="userNameRequest"><span>${actionOwnerName}</span><br />
	            <span class="notificationText"><b>${actionText}</b> ${componentText} của bạn</span><br />
	            <@updatedSince minutes=updatedMinutes prefix='page.dashboard.updateSince'/>. <br/>
	            </p>
	        </a>
	    </li>
    </#if>
</#macro>
